﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace IService.Entity
{
    public interface IBRoleService
    {

        #region Get
        /// <summary>
        /// 查询所有角色（分页）
        /// </summary>
        /// <param name="offset">页数</param>
        /// <param name="limit">每页数</param>
        /// <returns></returns>
        public Task<MessageModel<string>> GetAllToPage(int offset = 1, int limit = 15);

        /// <summary>
        /// 查询所有角色
        /// </summary>
        public Task<MessageModel<List<BRole>>> GetAll();

        /// <summary>
        /// 根据条件表达式查询数据列表
        /// </summary>
        /// <param name="whereExpression">条件表达式</param>
        /// <returns>数据列表</returns>
        public Task<MessageModel<List<BRole>>> GetByExpression<BRole>(Expression<Func<BRole, bool>> whereExpression);


        /// <summary>
        /// 查询角色按ID
        /// </summary>
        /// <param name="bRole"></param>
        /// <returns></returns>
        public Task<MessageModel<BRole>> GetById(int id);
        #endregion

        #region Post
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="bRole"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Post(BRole bRole);

        #endregion

        #region Put
        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="bRole"></param>
        /// <returns></returns>
        public Task<MessageModel<string>> Put(BRole bRole);

        #endregion

        #region Delete
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="bRole"></param>
        /// <returns></returns>
        public Task<MessageModel<bool>> DelById(int id);

        #endregion

    }
}
